import request from '@/utils/request';
import { SaveParams, UpdateParams, DetailParams } from './data';

// 关联楼盘下拉
export async function selectSearch(params: string) {
  return request('/api/sem/building', {
    method: 'POST',
    params: {
      buildingName: params
    }
  });
};

// 推广业务下拉
export async function getBusiness(params: {}) {
  return request('/api/other/getBusinessData', {
    method: 'POST',
    params
  });
};

// 保存
export async function save(params: SaveParams) {
  return request('/v1/sem/plan/add', {
    method: 'POST',
    data: params
  });
};

// 编辑
export async function update(params: UpdateParams) {
  return request('/v1/sem/plan/update', {
    method: 'POST',
    data: params
  });
};

// 获取计划详情
export async function getDetail(params: DetailParams) {
  return request('/v1/sem/plan/getPlan', {
    method: 'POST',
    data: params
  })
};